package com.ytjj.qmyx.supplychain.mapper;

import com.ytjj.qmyx.supplychain.common.model.dto.ProductDto;
import com.ytjj.qmyx.supplychain.common.model.request.BankerProductQueryRequest;
import com.ytjj.qmyx.supplychain.common.model.request.BankerProductRequest;
import com.ytjj.qmyx.supplychain.common.model.response.BankerProductDetailResponse;
import com.ytjj.qmyx.supplychain.common.model.response.BankerProductResponse;
import com.ytjj.qmyx.supplychain.common.model.response.ProductDataResponse;
import com.ytjj.qmyx.supplychain.mapper.entity.YxBankerProduct;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface BankerProductMapper extends Mapper<YxBankerProduct> {
    List<BankerProductResponse> getBankerProductList(BankerProductQueryRequest bankerProductQueryRequest);
    List<BankerProductResponse> exportDataToExcel(BankerProductQueryRequest bankerProductQueryRequest);
    void saveAndUpdate(ProductDto productDto);

    ProductDataResponse findInfoById(Integer productId);

    List<BankerProductResponse> selectList(BankerProductRequest bankerProductRequest);

    List<BankerProductDetailResponse> findInfoByIdList(Integer productId);

    List<BankerProductDetailResponse> findSupplyProductByIdList(Integer productId);

    List<BankerProductDetailResponse> findInfoByBankerProductIdList(Integer bankerProductId);

    void updateCategoryId(@Param("id") Integer id,
                          @Param("topCategoryId") Integer topCategoryId,
                          @Param("categoryId") Integer categoryId,
                          @Param("bottomCategoryId") Integer bottomCategoryId,
                          @Param("appraisalType") Integer appraisalType);


    Integer updateAuditStatus(@Param("bankerProductId") Integer bankerProductId,
                              @Param("auditStatus") Integer auditStatus, @Param("appraisalType") Integer appraisalType);

    Integer synvBankerColumn(@Param("bankerProductId") Integer bankerProductId,
                             @Param("bankerColumnId") Integer bankerColumnId);

    Integer verifyFail(@Param("id") Integer id, @Param("verifyRemarks") String verifyRemarks);

    Integer downProduct(@Param("bankerProductId") Integer bankerProductId, @Param("status") Integer status);

    Integer rollbackSupplyChainProduct(@Param("id") Integer id, @Param("status") Integer status);

    int updateStatusByProductId(@Param("ids") List<Integer> ids, @Param("status") Integer status, @Param("outOfSelection") String outOfSelection);

    void updateBrandByBrandId(Integer id);

    void updateAuditorById(@Param("id") Integer id, @Param("admin") String admin);

    Integer updateInfoImgById(@Param("id") Integer id,@Param("infoImgFinal") String infoImgFinal);

    List<Integer> getFreightTemplateProduct();

    List<YxBankerProduct> selectFreightIdById(@Param("list") List<Integer> subList);

    /**
     * 批量修改供应商商品分类
     * @param bankerProductIds
     * @param topCategoryId
     * @param categoryId
     * @param bottomCategoryId
     */
    void updateCategoryIdByIds(@Param("bankerProductIds") List<Integer> bankerProductIds,
                               @Param("topCategoryId") Integer topCategoryId,
                               @Param("categoryId") Integer categoryId,
                               @Param("bottomCategoryId") Integer bottomCategoryId);
}
